import { validateFloatInteger } from "@/utils/rules";

const formRules = {
  tempUpper: [
    {
      required: true,
      trigger: "blur",
      validator: validateFloatInteger("温度上限值", "温度上限值只能输入正整数")
    }
  ],
  tempLower: [
    {
      required: true,
      trigger: "blur",
      validator: validateFloatInteger("温度下限值", "温度下限值只能输入正整数")
    }
  ],
  humidnessUpper: [
    {
      required: true,
      trigger: "blur",
      validator: validateFloatInteger("湿度上限值", "湿度上限值只能输入正整数")
    }
  ],
  humidnessLower: [
    {
      required: true,
      trigger: "blur",
      validator: validateFloatInteger("湿度下限值", "湿度下限值只能输入正整数")
    }
  ],
  voltageError: [
    {
      required: true,
      validator: validateFloatInteger("电压限值", "电压限值只能输入正整数"),
      trigger: "blur"
    }
  ]
};

const formData = {
  tempUpper: null,
  tempLower: null,
  humidnessUpper: null,
  humidnessLower: null,
  voltageError: null
};

export { formRules, formData };
